#include <fmt/core.h>
#include <fmt/format.h>
#include <iostream>
#include <vector>

struct Person
{
    std::string name;
    int age;
};

int main()
{
    std::vector<Person> people = {
        {"Alice", 30},
        {"Bob", 25},
        {"Charlie", 35}};

    // 使用 fmt::format 进行字符串格式化
    std::string output;
    for (const auto &person : people)
    {
        output += fmt::format("Name: {0:<10} | Age: {1:02}\n", person.name, person.age);
    }

    // 使用 fmt::print 直接输出到标准输出
    fmt::print("List of People:\n{}\n", output);

    return 0;
}

/* 
List of People:
Name: Alice      | Age: 30
Name: Bob        | Age: 25
Name: Charlie    | Age: 35

 */